<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
	<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>  
	<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>  
    <style>
    div{color:red;}
    </style>
  </head>
  
  <body>
	<table border="1">
    <tr>
    <td colspan=6>
    <c:forEach items="${user.errors}" var="e">
    	<div>error:${e}</div>
    </c:forEach>
    <form action="test/user/add" method="POST" enctype="multipart/form-data">
    姓名<input name="name" value="${user.name}"><br>
    年龄<input name="age" value="${user.age}" class="easyui-numberbox" min="1" max="150"><br>
    头像<input name="file2" type="file"><br>
    证书<input name="file1" type="file"><br>
    生日<input name="birthday" value="${user.birthday}" class="easyui-datebox">(yyyy-MM-dd)<br>
    <input type="submit" value="save">
    </form></td></tr>
    <tr><td>ID</td><td>姓名</td><td>年龄</td><td>生日</td><td>创建日期</td><td>操作</td></tr>
    <c:forEach items="${users}" var="u">
    	<tr><td>${u.id}</td><td>${u.name}</td><td>${u.age}</td><td><fmt:formatDate value="${u.birthday}" pattern="yyyy-MM-dd"></fmt:formatDate></td><td>${u.createtime2}</td><td><a href="test/user/delete?id=${u.id}">删除</a> <a href="test/user/modify?id=${u.id}">修改</a></td></tr>
    </c:forEach>
	</table>
  </body>
</html>
